package service

import (
	"happy-sudoku/internal/manager"
	"happy-sudoku/internal/model"
)

// IPuzzleService is to be implemented by PuzzleService
type IPuzzleService interface {
	// GetOne get one puzzle by id
	GetOne(puzzleID int) (*model.Puzzle, error)
	// Check(puzzleID int, ansGrid sudoku.GridType) (sudoku.CheckResType, error)
	// GetPuzzleByDifficulty(difficulty model.Difficulty) (model.Puzzle, error)
}

// PuzzleService implements IPuzzleService
type PuzzleService struct {
	mgr manager.IPuzzleManager
}

// NewPuzzleService new puzzleService
func NewPuzzleService(mgr manager.IPuzzleManager) *PuzzleService {
	return &PuzzleService{
		mgr: mgr,
	}
}

// GetOne get one puzzle by id
func (p *PuzzleService) GetOne(puzzleID int) (*model.Puzzle, error) {
	return p.mgr.GetOne(puzzleID)
}
